package cn.edu.scau.cmi.heyaqing.simpleFactoryMethod;

public class PolicyProducer {
	public static AutoInsurance getPolicyObj(String option) {
		AutoInsurance policy = null;
		if(option.compareTo("bodyInjure") == 0)
			policy = new BodyInjur();
		else if(option.compareTo("carDamage") == 0)
			policy = new CarDamage();
		else if(option.compareTo("com") == 0)
			policy = new Com();
		else if(option.compareTo("personInjure") == 0)
			policy = new PersonInjur();
		return policy; 
	}
}